<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>试卷</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <script src="/layui/layui.all.js"></script>

</head>
<body>
<nav  th:replace="teacher/_fragments :: menu(4)" class="ui inverted  segment">
    <div class="ui container">
        <div class="ui inverted secondary menu">
            <h2 class="ui teal header item">CUMT</h2>
            <h3 class="ui teal header item">在线答题系统</h3>
            <a href="#" class="  item ">章节</a>
            <a href="#" class=" item ">知识点</a>
            <a href="#" class=" item ">题目</a>
            <a href="#" class="active item ">试卷</a>
            <a href="#" class=" item ">成绩</a>

            <div class="right menu   ">
                <div class="ui dropdown item">
                    <div class="text">
                       Zhaohaihang
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</nav>


<div class="ui container">

    <form  action="#" th:action=" @{/teacher/tea-paper-input}" th:object="${paper}"  method="post" class="ui  form">
        <input type="hidden" name="id" th:value="*{id}" >
        <div class=" required field">
            <div class="ui labeled input">
                    <div class="ui label">名称</div>
                <input   type="text" placeholder="试卷名称" name="name" th:value="*{name}">
            </div>
        </div>

        <div class="ui field">
            <div class="ui three column  grid">
                <div class="ui column">
                    <div class=" field">
                        <div class="ui left labeled action  input">
                            <div class="ui label">接收年级</div>
                            <div class="ui  selection   dropdown ">
                                <input type="hidden" value="grade" name="grade" th:value="*{grade}" class="">
                                <i class="dropdown icon"></i>
                                <div class=" default text ">年级</div>
                                <div class="menu">
                                    <div  th:each="gradee : ${grades}"  class="item"  data-value="1" th:data-value="${gradee}" th:text="${gradee}">2019级</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ui  column">
                    <div class="inline field">
                        <div class="ui  labeled input">
                            <div class="ui  label">开始时间</div>
                            <div class="layui-input-inline">
                                <input type="text" name="startTime" class="layui-input" onclick="settime('start')" id="start-input"
                                       placeholder="开始时间" th:value="*{startTime}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ui  column">
                    <div class="inline field">
                        <div class="ui  labeled input">
                            <div class="ui  label">结束时间</div>
                            <div class="layui-input-inline">
                                <input type="text" name="endTime" class="layui-input" onclick="settime('end')" id="end-input"
                                       placeholder="结束时间" th:value="*{endTime}">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="ui right aligned container">
            <button class="ui button " type="button" onclick="window.history.go(-1)">返回</button>
            <button type="submit" id="" class="ui orange button ">提交</button>
        </div>

        <div class="ui error message">

        </div>
    </form>

    <br>
</div>


<script>
    $('.ui.dropdown').dropdown({
        on: 'hover'
    });

    function f(idd){
        var text1 ='#t'+idd;
        layer.open({
            type: 1,
            title: '题目详情',
            area: ['600px', '360px'],
            shadeClose: true, //点击遮罩关闭
            content: $(text1).val(),
            //content: '\<\div style="padding:20px;">自定义内容\<\/div>'
        });
    }

    $('#add-question').on('click', function(){
        layer.open({
            type: 2,
            title: '选题',
            maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            area : ['1200px' , '600px'],
            content: 'tea-paper-question.html'
        });
    });

    function settime(name) {
        var tt ='#'+name+'-input';
        var laydate = layui.laydate;
        laydate.render({
            elem: tt,//指定元素
            type: 'datetime'
        });
    };


</script>
</body>
</html>